Skip to content

fix: turn off rules-of-hooks in test and e2e files - #12

Merged
altaywtf merged 1 commit into
mainfrom
fix/test-rules-of-hooks
Nov 28, 2026
Merged

altaywtf merged 1 commit into
mainfrom
fix/test-rules-of-hooks

Conversation

@altaywtf

Copy link
Copy Markdown
Member

Problem

react/rules-of-hooks flags Playwright and Vitest fixture callbacks, so non-Effect repos carry their own e2e overrides:

export const test = base.extend({
  page: async ({ baseURL }, use) => {
    await use({ url: baseURL });
  },
});

Solution

The base turns react/rules-of-hooks off in test and e2e files:

Glob Matches
**/*.{test,spec,integration,e2e}.{js,jsx,ts,tsx,mjs,mts,cjs,cts} Cloudflare's test-file names, JS included
**/__tests__/** Jest-style test folders
**/e2e/** Playwright folders
  • React tests that render hooks lose the rule in those files.
  • The /effect entries already turn it off everywhere.

Related: uinaf/oxlint-plugin-no-comments#21

Playwright and Vitest fixture callbacks call a `use` argument, which
react/rules-of-hooks reads as a React hook outside a component. Consumers
carried their own e2e overrides for it.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T15:16:58.050717Z f3c2658 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@altaywtf
altaywtf merged commit 145bfcb into main Nov 28, 2026
1 check passed
@altaywtf
altaywtf deleted the fix/test-rules-of-hooks branch November 28, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant